<?php
/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/5/11
 * Time: 下午4:40
 */

namespace App\Busi\Traits;


use App\Models\UrlTag;

Trait UrlTagTrait
{
    public function getTagNameByTypeId($typeId){
        $where = [
            ['id',"=",$typeId]
        ];
        $fields = ['name'];
        $data = UrlTag::where($where)->select($fields)->first();
        if($data){
            return $data['name'];
        }
        else{
            return "";
        }
    }
}